package cn.ycl.system.other.study.designMode.combination;

/**
 * @author YuanChangLiang
 * @description
 * @date created in 10:50 2021/7/22
 */
 import  java.util.Observable;

public class Test2 {
    public static void main(String[] args) {
        Subject concreteSubject = new ConcreteSubject();
        //观察者在被观察中注册
        ConcreteObserver concreteObserver = new ConcreteObserver();
        ConcreteObserver2 concreteObserver2 = new ConcreteObserver2();
        concreteSubject.attach(concreteObserver);
        concreteSubject.attach(concreteObserver2);
        //通知观察者们
        concreteSubject.inform();
    }
}
